use Dosvid
go

if exists(select 1
		  from sysobjects
		  where name = 'Employers')
  drop table Employers
go

create table Employers
(
  Id int identity(1,1) not null,
  EmployerName nvarchar(255) not null,
  [OwnerShip] nvarchar(255) null,
  AddressInLviv nvarchar(255) null,
  AddressOfMainOffice nvarchar(255) null,
  DirectionOfBusiness nvarchar(255) null,
  TradeMarks nvarchar(255) null,
  WebResource nvarchar(255) null,
  DateOfFirstMeet datetime null,
  ManagerId int not null
)  
go

alter table Employers add constraint PK_Employers_ID primary key(Id) 
go


alter table Employers add constraint FK_Employers_ManagerId 
      foreign key (ManagerId) references Users(Id) on delete cascade
go


create nonclustered index IX_Employers_ManagerId on Employers
       (ManagerId asc)
go

